package edu.vt.ece_3574.amber_alert.location;

public class PendingLocateAccount {
	private static PendingLocateAccount instance = new PendingLocateAccount();
	
	private boolean done;
	
	public static PendingLocateAccount get() {
		return instance;
	}
	
	public synchronized void await() {
		if (!done) {
			try {
				wait();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	
	public void reset() {
		done = false;
	}
	
	public synchronized void located() {
		done = true;
		notify();
	}
	
	public boolean done() {
		return done;
	}
}
